<template>
    <div class="template-header">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.html">上海汇芈医药科技有限公司</a>
        </div>
        <!-- Top Menu Items -->
        <ul class="nav navbar-right top-nav">
            <li class="dropdown search-box">
                <i class="iconfont icon-sousuo"></i>
                <input type="text" class="form-control" placeholder="请输入关键字搜索">
            </li>
            <li class="dropdown portrait-box">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="h-icon"><img :src="cfg.assets+'/images/lsgl-m.png'"></i>{{userInfo.shky}}
                    <em>23</em>
                </a>
            </li>
            <li class="dropdown help-box">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">帮助</a>
            </li>
            <li class="dropdown help-box">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" @click="onBack">退出</a>
            </li>
        </ul>
    </div>
</template>
<script>
    import bus from "../../api/eventBus";
    import {
        setUi,
        setUserInfo,
        setLoginState
    } from "../../vuex/actions";
    import {
        ui,
        userInfo,
        mainTable,
        loginState
    } from "../../vuex/getters";
    export default {
        data() {
            return {};
        },
        vuex: {
            getters: {
                ui,
                userInfo,
                mainTable,
                loginState
            },
            actions: {
                setUi,
                setUserInfo,
                setLoginState
            }
        },
        methods: {
            onBack(e) {
                let me = this;
                console.log(me.mainTable,'sssssssssssssssssss');
                me.setUserInfo({});
                me.$router.push({
                    path: "/login"
                });
                me.onfullScreen();
                sessionStorage.removeItem("sktId");
                sessionStorage.removeItem('user');
                me.setLoginState = true;
            },
            onfullScreen() {
                var docElm = document.documentElement;
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                } else if (document.mozCancelFullScreen) {
                    document.mozCancelFullScreen();
                } else if (document.webkitCancelFullScreen) {
                    document.webkitCancelFullScreen();
                } else if (document.msExitFullscreen) {
                    document.msExitFullscreen();
                }
            }
        },
        mounted() {
            let me = this;
        },
    };
</script>